package com.neusoft.cloudstreamfeign.feign;

import com.neusoft.cloudstreamfeign.config.FeignConfig;
import com.neusoft.cloudstreamfeign.dto.Result;
import com.neusoft.cloudstreamfeign.dto.ServiceInfo;
import com.neusoft.cloudstreamfeign.dto.SiteInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 站点服务Feign客户端
 */

@FeignClient(
        name = "cloud-site-service",
        contextId = "siteServiceClient",
        path = "/api/site",
        fallback = DeliveryServiceFallback.class,
        configuration = FeignConfig.class
)
public interface SiteServiceClient {

    @GetMapping("/serviceInfo/list")
    Result list(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,
                @RequestParam(value = "siteId", required = false) Long siteId, @RequestParam(value = "serviceCode", required = false) String serviceCode);

    @PostMapping( "/serviceInfo/create")
    Result create(@RequestBody ServiceInfo serviceInfo);

    @PostMapping( "/serviceInfo/update")
    Result update(@RequestBody ServiceInfo serviceInfo);

    @PostMapping("/serviceInfo/delete")
    Result delete(@RequestBody ServiceInfo serviceInfo);

    @GetMapping("/siteInfo/list")
    Result list1(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,
                 @RequestParam(value = "siteCode", required = false) String siteCode);

    @PostMapping("/siteInfo/create")
    Result create1(@RequestBody SiteInfo siteInfo);

    @PostMapping("/siteInfo/update")
    Result update1(@RequestBody SiteInfo siteInfo);

    @PostMapping("/siteInfo/delete")
    Result delete1(@RequestBody ServiceInfo serviceInfo);

}
